import request from '@/utils/request'
import { timeFormat,dateDiff }  from '@/utils/dateUtil'
const api = {}

let stat = {'-1': '已下载', 0: '下载中', 1: '等待文件生成', 2: '已完成' }

  //日志管理文件下载日志查询
  api.getListDownloadLog = data => {
    let p = request({
      url: `/log/downloadLog/getListDownloadLog`,
      method: 'get',
      params: data
    })
    p.then(res=>{
      let page = res.data.page;
      page.list.forEach(e=>{
        e.createTime = timeFormat(e.createTime)
        debugger
        if(e.stat == 2 && dateDiff(new Date(),e.createTime) < 15){
          e.show =true
        }else{
          e.show = false
        }
      })
      return page;
    }) 
    return p;
  }
  
   export default api